import monitor.check_redis as check_redis
import monitor.check_oracle as check_oracle
import time

try:
    import utils.config_util as config_util
except Exception:
    import config_util

def get_software_info():
    software = {}
    check = config_util.get_config("redis", "check").lower()
    if check == "true":
        redis = check_redis.check_local_redis()
        if redis != {}:software["redis"] = redis
    check = config_util.get_config("oracle", "check").lower()
    if check == "true":
        oracle = check_oracle.check_local_oracle()
        if oracle != {}:software["oracle"] = oracle
    return software


if __name__ == '__main__':
    start = time.time()
    print(get_software_info())
    end = time.time()
    print(end - start)
